import http from '@/api/request'
//商品列表
function proList(kv){
  return http({
    url:'/api/leju/admin/product/list',
    method:'GET',
    kv
  })
}
//更新某个字段
function upwhitchCode(kv){
  return http({
    url:'/api/leju/admin/product/switchCode',
    method:'post',
    kv
  })
}
//编辑OR新增商品
function uporSave(kv){
  return http({
    url:'/api/leju/admin/product/saveOrUpdate',
    method:'post',
    kv
  })
}
//更新某些属性
function upBaseCode(kv){
  return http({
    url:'/api/leju/admin/product/updateProduct',
    method:'post',
    kv
  })
}
//商品明细
function productDetail(kv){
  return http({
    url:'/api/leju/admin/product/detail',
    method:'GET',
    kv
  })
}
//删除商品
function delProduct(kv){
  return http({
    url:'/api/leju/admin/product/delete',
    method:'GET',
    kv
  })
}
//获取sku列表
function skuList(kv){
  return http({
    url:'/api/leju/admin/productSku/skuList',
    method:'GET',
    kv
  })
}
//新增或更新sku
function skuUpdata(kv){
  return http({
    url:'/api/leju/admin/productSku/saveOrUpdate',
    method:'POST',
    kv

  })
}
//删除当前sku库存
function delSkuCount(kv){
  return http({
    url:'/api/leju/admin/productSku/del',
    method:'GET',
    kv
  })
}
export default {
  proList,
  upwhitchCode,
  uporSave,
  upBaseCode,
  productDetail,
  delProduct,
  skuList,
  skuUpdata,
  delSkuCount

}
